<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>configLoad()</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
<link rel="home" href="index.html" title="Smarty 3 Manual">
<link rel="up" href="api.functions.html" title="Chapter 14. Smarty Class Methods">
<link rel="prev" href="api.compile.all.templates.html" title="compileAllTemplates()">
<link rel="next" href="api.create.data.html" title="createData()">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<div class="navheader">
<table width="100%" summary="Navigation header">
<tr><th colspan="3" align="center">configLoad()</th></tr>
<tr>
<td width="20%" align="left">
<a accesskey="p" href="api.compile.all.templates.html">Prev</a> </td>
<th width="60%" align="center">Chapter 14. Smarty Class Methods</th>
<td width="20%" align="right"> <a accesskey="n" href="api.create.data.html">Next</a>
</td>
</tr>
</table>
<hr>
</div>
<div class="refentry" title="configLoad()">
<a name="api.config.load"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2>Name</h2>
<p>configLoad() —  loads config file  data and assigns it to the template</p>
</div>
<div class="refsect1" title="Description">
<a name="id430424"></a><h2>Description</h2>
<code class="methodsynopsis"><span class="type">void </span><span class="methodname">configLoad</span>(<span class="methodparam"><span class="type">string </span><span class="parameter">file</span></span>,<br>                <span class="methodparam"><span class="type">string </span><span class="parameter">section</span></span>);</code><p>
   This loads
   <a class="link" href="config.files.html" title="Chapter 9. Config Files">config file</a>
   data and assigns it to
   the template. This works identically to the template
   <a class="link" href="language.function.config.load.html" title="{config_load}">
   <code class="varname">{config_load}</code></a> function.
  </p>
<div class="note" title="Technical Note" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Technical Note</h3>
<p>
    As of Smarty 2.4.0, assigned template variables are kept across
    invocations of
    <a class="link" href="api.fetch.html" title="fetch()"><code class="varname">fetch()</code></a>
    and <a class="link" href="api.display.html" title="display()"><code class="varname">display()</code></a>.
    Config vars loaded from
    <code class="varname">configLoad()</code> are always global in scope.
    Config files are also  compiled for faster execution, and respect the
    <a class="link" href="variable.force.compile.html" title="$force_compile">
    <em class="parameter"><code>$force_compile</code></em></a> and
    <a class="link" href="variable.compile.check.html" title="$compile_check">
    <em class="parameter"><code>$compile_check</code></em></a> settings.
   </p>
</div>
<div class="example">
<a name="id430966"></a><p class="title"><b>Example 14.16. configLoad()</b></p>
<div class="example-contents"><pre class="programlisting">

&lt;?php
// load config variables and assign them
$smarty-&gt;configLoad('my.conf');

// load a section
$smarty-&gt;configLoad('my.conf', 'foobar');
?&gt;

   </pre></div>
</div>
<br class="example-break"><p>
  See also
  <a class="link" href="language.function.config.load.html" title="{config_load}"><code class="varname">{config_load}</code></a>,
  <a class="link" href="api.get.config.vars.html" title="getConfigVars()"><code class="varname">getConfigVars()</code></a>,
  <a class="link" href="api.clear.config.html" title="clearConfig()"><code class="varname">clearConfig()</code></a>,
  and
  <a class="link" href="language.config.variables.html" title="Variables loaded from config files"><code class="varname">config variables</code></a>
  </p>
</div>
</div>
<div class="navfooter">
<hr>
<table width="100%" summary="Navigation footer">
<tr>
<td width="40%" align="left">
<a accesskey="p" href="api.compile.all.templates.html">Prev</a> </td>
<td width="20%" align="center"><a accesskey="u" href="api.functions.html">Up</a></td>
<td width="40%" align="right"> <a accesskey="n" href="api.create.data.html">Next</a>
</td>
</tr>
<tr>
<td width="40%" align="left" valign="top">compileAllTemplates() </td>
<td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td>
<td width="40%" align="right" valign="top"> createData()</td>
</tr>
</table>
</div>
</body>
</html>
